<div id="sModuleTabs">
   <ul>
      <li>
          <a href="{$URL_RELATIVE}/bo/#{$group->getRightUrl($group->getLang(),'website')}" title="{t}Pages{/t}" rel="history">
              <span>{t}Pages{/t}</span>
          </a>
      </li>
      <li>
          <a href="{$URL_RELATIVE}/bo/#{$group->getRightUrl($group->getLang(),'medias')}" title="{t}Media{/t}" rel="history">
              <span>{t}Medias{/t}</span>
          </a>
      </li>
      <li>
          <a href="{$URL_RELATIVE}/bo/#{$group->getRightUrl($group->getLang(),'modules')}" title="{t}Contents{/t}" rel="history">
              <span>{t}Contents{/t}</span>
          </a>
      </li>
   </ul>
</div>
<div id="sTabContent">
    <table class="listTable">
        <tr>
            <th class="nobg">{t}Permissions{/t}</td>
            <th style="width: 100px" class="nobg">{t}Acces Front{/t}</td>
            <th style="width: 100px" class="nobg">{t}Show{/t}</td>
            <th style="width: 100px" class="nobg">{t}Modify{/t}</td>
            <th style="width: 100px" class="nobg">{t}Create{/t}</td>
            <th style="width: 100px" class="nobg">{t}Delete{/t}</td>
        </tr>
        <tr>
            <td colspan="6" style="padding-left: 0px; border: none;">
                {if $modules}
                <div id="modulesList">
                    {foreach from=$modules item=value}
                    {if $value->hasModuleFolderList() == true}
                    <h3>
                        <a href="#">{$value->getDescription()}</a>
                        <div style="display: none">{$value->getName()}</div>
                    </h3>
                    <div>
                    </div>
                    {/if}
                    {/foreach}
                </div>
                {else}
                    {$docList}
                {/if}
            </td>
        </tr>
    </table>
</div>

{literal}
<script type="text/javascript">
    $(document).ready(function(){
        $("#docList").treeview({
            url: {/literal}"index.php?module=rights&action=AjaxListRights&subTabName={$subTabName}&accordionTabName={$accordionTabName}&docId={$group->getUniqueId()}"{literal},
            animated: "fast",
            collapsed: true,
            unique: true
        });

        $('#docList li').live('mouseover',function(){
                $(this).children('span').css("background","#E4E2DA").children('div').css("background","#E4E2DA");
        }).live('mouseout', function(){
                $(this).children('span').css("background","#FFF").children('div').css("background","#FFF");
        });

        $("#modulesList").accordion({
            navigation: true,
            clearStyle: true,
            active: false,
            collapsible: true,
            changestart: function(event, ui){
                $.ajax({
                    url: '?module=rights&action=block_ListRights',
                    data: {docId:{/literal}{$group->getUniqueId()}{literal},subTabName: {/literal}'{$subTabName}'{literal}, accordionTabName: ui.newHeader.children('div').text()},
                    success: function(resp)
                    {
                        ui.oldContent.empty();
                        ui.newContent.html(resp);
                    }
                });
            }
        });
    });
</script>
{/literal}
